package com.bootx.config;

import dev.langchain4j.model.embedding.EmbeddingModel;
import dev.langchain4j.model.ollama.OllamaEmbeddingModel;
import dev.langchain4j.model.openai.OpenAiEmbeddingModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author black
 */
@Configuration
public class EmbeddingModelConfig {

    @Bean(name = "ollamaEmbeddingModel")
    public EmbeddingModel ollamaEmbeddingModel(){
        return OllamaEmbeddingModel.builder()
                .baseUrl("http://localhost:11434")
                .modelName("deepseek-r1")
                .build();
    }
    @Bean(name = "openAiEmbeddingModel")
    public EmbeddingModel openAiEmbeddingModel(){
        return OpenAiEmbeddingModel.builder()
                .apiKey("sk-j47dE2qVRvW7mJdpnb6GkwodymhU4PczyvTYhPqfFxED7rXz")
                .baseUrl("https://xiaoai.plus/v1")
                .modelName("gpt-4o")
                .build();
    }
}
